<template>
  <div class="app-container">
    <!-- row1 -->
    <el-row>
      <!-- 订单录入 -->
      <el-col :span="12" class="card-box">
        <el-card>
          <div slot="header"><span>订单录入</span></div>
          <div class="el-table el-table--enable-row-hover el-table--medium " style="height:740px">
            <el-form ref="form" :model="form" :rules="rules" label-width="80px">
              <el-form-item label="订单ID" prop="orderId">
                <el-input v-model="form.orderId" placeholder="请输入订单ID" :disabled="true" />
              </el-form-item>
              <el-form-item label="客户姓名" prop="clientName">
                <el-input v-model="form.clientName" placeholder="请输入客户姓名" />
              </el-form-item>
              <el-form-item label="客户电话" prop="clientPhone">
                <el-input v-model="form.clientPhone" placeholder="请输入客户电话" />
              </el-form-item>
              <el-form-item label="交付日期" prop="dateReleased">
                <el-date-picker clearable size="small" v-model="form.dateReleased" type="date"
                  value-format="yyyy-MM-dd " placeholder="选择交付日期">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="录入时间" prop="inputime">
                <el-date-picker clearable size="small" v-model="form.inputime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择录入时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="录入人员" prop="salesman">
                <el-select v-model="form.salesman">
                  <el-option v-for="dict in dict.type.sys_cme_ordermen" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>

              <el-form-item label="交底人" prop="dataPreprocessor">
                <el-select v-model="form.dataPreprocessor" placeholder="请选择技术交底人" clearable>
                  <el-option v-for="dict in dict.type.sys_cme_technicalhandover" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="技术要求" prop="technicalRequirements">
                <el-input type="textarea" v-model="form.technicalRequirements" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="上传">
                <cme-file-upload :orderid="form.orderId" />
              </el-form-item>
              <el-form-item label="下载">
                <el-link :underline="false">
                  <el-button type="primary" @click="getorderfile">获取文件<i class="el-icon-download el-icon--right"></i>
                  </el-button>
                </el-link>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitForm">提交</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
      <!-- 前处理 -->
      <el-col :span="12" class="card-box">
        <el-card>
          <div slot="header"><span>前处理</span></div>
          <div class="el-table el-table--enable-row-hover el-table--medium " style="height: 740px">
            <el-form ref="form" :model="preprocess" :rules="rules" label-width="80px">
              <el-form-item label="订单ID" prop="orderId">
                <el-input v-model="preprocess.orderId" placeholder="请输入订单ID" :disabled="true" />
              </el-form-item>
              <el-form-item label="打印人员" prop="printer">
                <el-select v-model="preprocess.printer" placeholder="请选择打印人员" clearable>
                  <el-option v-for="dict in dict.type.sys_cme_printman" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="前处理人" prop="orderPostmen">
                <el-select v-model="preprocess.orderPostmen" multiple @change="$forceUpdate()" placeholder="请选择">
                  <el-option v-for="item in dict.type.sys_cme_beforeman" :key="parseInt(item.value)" :label="item.label"
                    :value="parseInt(item.value)" :disabled="false"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="处理结果">
                <el-radio-group v-model="preprocess.result">
                  <el-radio v-for="dict in dict.type.sys_result" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="是否处理">
                <el-radio-group v-model="preprocess.isHandl">
                  <el-radio v-for="dict in dict.type.sys_is_handling" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="处理记录" prop="preProcessingRecord">
                <el-input v-model="preprocess.preProcessingRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="其他" prop="other">
                <el-input v-model="preprocess.other" placeholder="请输入其他" />
              </el-form-item>
              <el-form-item label="上传文件">
                <!--<file-upload/>-->
                <PreprocessFileUpload :orderid="preprocess.orderId" />
              </el-form-item>
              <el-form-item label="下载">
                <el-link :underline="false">
                  <el-button type="primary" @click="getpreprocessfile()">获取文件<i
                      class="el-icon-download el-icon--right"></i></el-button>
                </el-link>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitpreprocess">提交</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <!-- row2 -->
    <el-row>
      <!-- 打印处理 -->
      <el-col :span="12" class="card-box">
        <el-card>
          <div slot="header"><span>打印处理</span></div>
          <div class="el-table el-table--enable-row-hover el-table--medium " style="height:860px">
            <el-form ref="form" :model="printprocessList" :rules="rules" label-width="110px">
              <el-form-item label="订单ID" prop="orderId">
                <el-input v-model="printprocessList.orderId" placeholder="请输入订单ID" :disabled="true" />
              </el-form-item>
              <el-form-item label="打印人员" prop="printer">
                <el-select v-model="printprocessList.printer" placeholder="请选择打印人员" clearable>
                  <el-option v-for="dict in dict.type.sys_cme_printman" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="打印名称" prop="printName">
                <el-input v-model="printprocessList.printName" placeholder="请输入打印名称" />
              </el-form-item>


<!--              <el-form-item label="打印类型" prop="printItem">-->
<!--                <el-input v-model="printprocessList.printItem" placeholder="请输入打印类型" />-->
<!--              </el-form-item>-->

<!--              <el-form-item label="打印类型">-->
<!--                <el-radio-group v-model="printprocessList.printItem">-->
<!--                  <el-radio v-for="dict in dict.type.sys_cme_metalPrintitem" :key="dict.value" :label="parseInt(dict.value)">-->
<!--                    {{dict.label}}</el-radio>-->
<!--                </el-radio-group>-->
<!--              </el-form-item>-->

              <el-form-item label="打印类型" prop="printItem">
                <el-select v-model="printprocessList.printItem" placeholder="请选择打印类型" clearable>
                  <el-option v-for="dict in dict.type.sys_cme_metalPrintitem" :key="dict.value" :label="dict.label"
                             :value="dict.value" />
                </el-select>
              </el-form-item>


              <el-form-item label="打印时长(分钟)" prop="printrTime">
                <el-input v-model="printprocessList.printrTime" placeholder="请输入打印时长" />
              </el-form-item>
              <el-form-item label="设备状态">
                <el-radio-group v-model="printprocessList.deviceStatus">
                  <el-radio v-for="dict in dict.type.sys_device_status" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="开始时间" prop="startTime">
                <el-date-picker clearable size="small" v-model="printprocessList.startTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="结束时间" prop="overTime">
                <el-date-picker clearable size="small" v-model="printprocessList.overTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="质检记录" prop="qualityRecord">
                <el-input v-model="printprocessList.qualityRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="是否合格">
                <el-radio-group v-model="printprocessList.isqualified">
                  <el-radio v-for="dict in dict.type.sys_quality_result" :key="dict.value"
                    :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="热处理人员" prop="heatPreprocessor">
                <el-select v-model="printprocessList.heatPreprocessor" placeholder="请选择热处理人员">
                  <el-option v-for="dict in dict.type.sys_cme_heatman" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="是否处理">
                <el-radio-group v-model="printprocessList.isHandl">
                  <el-radio v-for="dict in dict.type.sys_is_handling" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="异常记录" prop="unnormalRecord">
                <el-input v-model="printprocessList.unnormalRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitprintprocess">提 交</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
      <!-- 热处理 -->
      <el-col :span="12" class="card-box">
        <el-card>
          <div slot="header"><span>热处理</span></div>
          <div class="el-table el-table--enable-row-hover el-table--medium " style="height:860px">
            <el-form ref="form" :model="heatPreprocessList" :rules="rules" label-width="110px">
              <el-form-item label="订单ID" prop="orderId">
                <el-input v-model="heatPreprocessList.orderId" placeholder="请输入订单ID" :disabled="true" />
              </el-form-item>
              <el-form-item label="热处理人员" prop="heatPreprocessor">
                <el-select v-model="heatPreprocessList.heatPreprocessor" placeholder="请选择热处理人员">
                  <el-option v-for="dict in dict.type.sys_cme_heatman" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="设备状态">
                <el-radio-group v-model="heatPreprocessList.deviceStatus">
                  <el-radio v-for="dict in dict.type.sys_device_status" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="开始时间" prop="startTime">
                <el-date-picker clearable size="small" v-model="heatPreprocessList.startTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="结束时间" prop="overTime">
                <el-date-picker clearable size="small" v-model="heatPreprocessList.overTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="处理工序" prop="qualityRecord">
                <el-input v-model="heatPreprocessList.qualityRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="是否合格">
                <el-radio-group v-model="heatPreprocessList.isqualified">
                  <el-radio v-for="dict in dict.type.sys_quality_result" :key="dict.value"
                    :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="线切割人员" prop="wirer">
                <el-select v-model="heatPreprocessList.wirer" placeholder="请选择线切割人员" clearable size="small">
                  <el-option v-for="dict in dict.type.sys_cme_wirecuttingman" :key="dict.value" :label="dict.label"
                    :value="dict.value" />
                </el-select>
              </el-form-item>
              <el-form-item label="处理时长(分钟)" prop="heatProcessTime">
                <el-input v-model="heatPreprocessList.heatProcessTime" placeholder="请输入热处理时长" />
              </el-form-item>
              <el-form-item label="是否处理">
                <el-radio-group v-model="heatPreprocessList.isHandl">
                  <el-radio v-for="dict in dict.type.sys_is_handling" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="异常记录" prop="unusualRecord">
                <el-input v-model="heatPreprocessList.unusualRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitheatprocess">提 交</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <!-- row3 -->
    <el-row>
      <!-- 线切割 -->
      <el-col :span="12" class="card-box">
        <el-card>
          <div slot="header"><span>线切割</span></div>
          <div class="el-table el-table--enable-row-hover el-table--medium " style="height: 760px">
            <el-form ref="form" :model="wirecutList" :rules="rules" label-width="110px">
              <el-form-item label="订单ID" prop="orderId">
                <el-input v-model="wirecutList.orderId" placeholder="请输入订单ID" :disabled="true" />
              </el-form-item>

<!--              <el-form-item label="线切割人" prop="wireCutor">-->
<!--                <el-input v-model="wirecutList.wireCutor" placeholder="请输入线切割人" />-->
<!--              </el-form-item>-->

              <el-form-item label="线切割人员" prop="wireCutor">
                <el-select v-model="wirecutList.wireCutor" placeholder="请选择线切割人员" clearable size="small">
                  <el-option v-for="dict in dict.type.sys_cme_wirecuttingman" :key="dict.value" :label="dict.label"
                             :value="dict.value" />
                </el-select>
              </el-form-item>

              <el-form-item label="设备状态">
                <el-radio-group v-model="wirecutList.deviceStatus">
                  <el-radio v-for="dict in dict.type.sys_device_status" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="开始时间" prop="startTime">
                <el-date-picker clearable size="small" v-model="wirecutList.startTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="结束时间" prop="overTime">
                <el-date-picker clearable size="small" v-model="wirecutList.overTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="处理时长(分钟)" prop="wireCutTime">
                <el-input v-model="wirecutList.wireCutTime" placeholder="请输入处理时长" />
              </el-form-item>
              <el-form-item label="处理工序" prop="qualityRecord">
                <el-input v-model="wirecutList.qualityRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="是否合格">
                <el-radio-group v-model="wirecutList.isqualified">
                  <el-radio v-for="dict in dict.type.sys_quality_result" :key="dict.value"
                    :label="parseInt(dict.value)">{{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
<!--              <el-form-item label="后处理人" prop="postProcessor">-->
<!--                <el-input v-model="wirecutList.postProcessor" placeholder="请输入后处理人" />-->
<!--              </el-form-item>-->

              <el-form-item label="后处理人" prop="postProcessor">
                <el-select v-model="wirecutList.postProcessor" placeholder="请选择线切割人员" clearable size="small">
                  <el-option v-for="dict in dict.type.sys_cme_postman" :key="dict.value" :label="dict.label"
                             :value="dict.value" />
                </el-select>
              </el-form-item>

              <el-form-item label="是否处理">
                <el-radio-group v-model="wirecutList.isHandl">
                  <el-radio v-for="dict in dict.type.sys_is_handling" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="异常记录" prop="unusualRecord">
                <el-input v-model="wirecutList.unusualRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitwirecut">提 交</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
      <!-- 后处理 -->
      <el-col :span="12" class="card-box">
        <el-card>
          <div slot="header"><span>后处理</span></div>
          <div class="el-table el-table--enable-row-hover el-table--medium " style="height: 760px">
            <el-form ref="form" :model="postprocessList" :rules="rules" label-width="110px">
              <el-form-item label="订单ID" prop="orderId">
                <el-input v-model="postprocessList.orderId" placeholder="请输入订单ID" :disabled="true" />
              </el-form-item>
<!--              <el-form-item label="后处理人" prop="postProcessor">-->
<!--                <el-input v-model="postprocessList.postProcessor" placeholder="请输入后处理人" />-->
<!--              </el-form-item>-->

<!--              <el-form-item label="后处理人" prop="postProcessor">-->
<!--                <el-radio-group v-model="postprocessList.postProcessor">-->
<!--                  <el-radio v-for="dict in dict.type.sys_cme_postman" :key="dict.value" :label="parseInt(dict.value)">-->
<!--                    {{dict.label}}</el-radio>-->
<!--                </el-radio-group>-->
<!--              </el-form-item>-->


              <el-form-item label="后处理人" prop="postProcessor">
                <el-select v-model="postprocessList.postProcessor" placeholder="请选择线切割人员" clearable size="small">
                  <el-option v-for="dict in dict.type.sys_cme_postman" :key="dict.value" :label="dict.label"
                             :value="dict.value" />
                </el-select>
              </el-form-item>



              <el-form-item label="设备状态">
                <el-radio-group v-model="postprocessList.deviceStatus">
                  <el-radio v-for="dict in dict.type.sys_device_status" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="开始时间" prop="startTime">
                <el-date-picker clearable size="small" v-model="postprocessList.startTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="结束时间" prop="overTime">
                <el-date-picker clearable size="small" v-model="postprocessList.overTime" type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="处理时长(分钟)" prop="postProcessTime">
                <el-input v-model="postprocessList.postProcessTime" placeholder="请输入处理时长" />
              </el-form-item>
              <el-form-item label="处理工序" prop="qualityRecord">
                <el-input v-model="postprocessList.qualityRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="是否合格">
                <el-radio-group v-model="postprocessList.isqualified">
                  <el-radio v-for="dict in dict.type.sys_quality_result" :key="dict.value"
                    :label="parseInt(dict.value)">{{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="是否处理">
                <el-radio-group v-model="postprocessList.isHandl">
                  <el-radio v-for="dict in dict.type.sys_is_handling" :key="dict.value" :label="parseInt(dict.value)">
                    {{dict.label}}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="异常记录" prop="unusualRecord">
                <el-input v-model="postprocessList.unusualRecord" type="textarea" placeholder="请输入内容" />
              </el-form-item>
              <el-form-item label="其他" prop="other">
                <el-input v-model="postprocessList.other" type="textarea" placeholder="请输入内容" />
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitPostprocess">提 交</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>

</template>

<script>
  import {
    listPostprocess,
    getPostprocess,
    delPostprocess,
    addPostprocess,
    updatePostprocess
  } from "@/api/metal/postprocess/postprocess";
  import {
    listWirecut,
    getWirecut,
    delWirecut,
    addWirecut,
    updateWirecut
  } from "@/api/metal/wirecut/wirecut";
  import {
    listHeatPreprocess,
    getHeatPreprocess,
    delHeatPreprocess,
    addHeatPreprocess,
    updateHeatPreprocess
  } from "@/api/metal/HeatPreprocess/HeatPreprocess";
  import {
    listPreprocess,
    getPreprocess,
    updatePreprocess
  } from "@/api/metal/DataPreprocess/preprocess";
  import {
    getFileInformation,
    listZxorderurl
  } from '@/api/cmecomon/zxorderurl';
  import {
    listPrintProcess,
    getPrintProcess,
    delPrintProcess,
    addPrintProcess,
    updatePrintProcess
  } from "@/api/metal/PrintProcess/PrintProcess";
  import {
    download
  } from '@/utils/request';
  import {
    addForm,
    listForm,
    updateForm
  } from "@/api/order/form";
  import CmeFileUpload from "@/cmecomponents/FileUpload";
  import PreprocessFileUpload from "@/cmecomponents/preprocessFileupload";
  import ElFormItem from "element-ui/packages/form/src/form-item";

  export default {
    name: "CmeMetaletail",
    dicts: ['sys_result', 'sys_is_handling', 'sys_device_status', 'sys_quality_result', 'sys_cme_beforeman',
      'sys_cme_ordermen', 'sys_cme_technicalhandover', 'sys_cme_printman', 'sys_cme_heatman','sys_cme_wirecuttingman',,'sys_cme_postman','sys_cme_metalPrintitem'
    ],
    components: {
      ElFormItem,
      CmeFileUpload,
      PreprocessFileUpload
    },

    data() {
      return {
        //笼罩层
        loading: true,
        // 表单参数
        form: {},
        preprocess: {},
        //文件路径列表
        urlList: {},

        printprocessList: {},
        heatPreprocessList: {},
        wirecutList: {},
        postprocessList: {},
        // 表单校验
        rules: {
          orderId: [{
            required: true,
            message: "订单ID不能为空",
            trigger: "blur"
          }],
          orderPostmen: [{
            type: 'array',
            required: true,
            message: "前处理人不能为空",
            trigger: 'change'
          }]
        },

        //order文件名
        orderfilename: null,
        //order文件路径
        orderurl: null,

        //前处理文件名
        predatafilename: null,
        //前处理文件路径
        predataurl: null,

        queryParams: {
          pageNum: 1,
          pageSize: 10,
          orderId: null,
          oederid: null,
          resource: null,
        },

        whatfile: 111110

      };
    },

    created() {
      this.getsartdetail();
    },

    mounted() {

    },

    methods: {
      getsartdetail() {
        this.loading = true;

        //获取路由跳转时的传参
        let orderid = this.$route.query.orderid
        this.queryParams.orderId = orderid;
        this.queryParams.oederid = orderid;

        //获取订单原始数据
        listForm(this.addDateRange(this.queryParams)).then(response => {
          this.form = response.rows[0];
        });

        //获取预处理数据原始数据
        listPreprocess(this.queryParams).then(response => {
          this.preprocess = response.rows[0];

          const id = this.preprocess.id;
          getPreprocess(id).then(response => {
            this.preprocess.orderPostmen = response.orderPostmen;
          });
        });

        //获取url原始数据
        listZxorderurl(this.queryParams).then(response => {
          this.urlList = response.rows[0];
        });

        //获取文件信息
        getFileInformation(this.queryParams).then(response => {
          this.orderfilename = response.orderfilename;
          this.orderurl = response.orderurl;
          this.predatafilename = response.predatafilename;
          this.predataurl = response.predataurl;
        });

        //获取打印数据
        listPrintProcess(this.queryParams).then(response => {
          this.printprocessList = response.rows[0];
        });

        //获取热处理数据
        listHeatPreprocess(this.queryParams).then(response => {
          this.heatPreprocessList = response.rows[0];
        });

        //获取线切割数据
        listWirecut(this.queryParams).then(response => {
          this.wirecutList = response.rows[0];
        });

        //获取后处理数据
        listPostprocess(this.queryParams).then(response => {
          this.postprocessList = response.rows[0];
        });

        this.loading = false;
      },


      /** 提交修改order按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            updateForm(this.form).then(response => {
              this.$modal.msgSuccess("修改订单信息成功");
              this.open = false;
              this.getsartdetail();
            });
          }
        });
      },

      //**提交修改preprocess按钮*/
      submitpreprocess() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            updatePreprocess(this.preprocess).then(response => {
              this.$modal.msgSuccess("修改前处理信息成功");
              this.open = false;
              this.getsartdetail();
            });
          }
        });
      },

      //**提交修改printprocess按钮*/
      submitprintprocess() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            updatePrintProcess(this.printprocessList).then(response => {
              this.$modal.msgSuccess("修改打印过程数据成功");
              this.open = false;
              this.getsartdetail();
            });
          }
        });
      },

      /** 提交修改heatpreprocess按钮 */
      submitheatprocess() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            updateHeatPreprocess(this.heatPreprocessList).then(response => {
              this.$modal.msgSuccess("修改热处理成功");
              this.open = false;
              this.getsartdetail();
            });
          }
        });
      },

      /** 提交修改wirecut按钮 */
      submitwirecut() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            updateWirecut(this.wirecutList).then(response => {
              this.$modal.msgSuccess("修改线切割成功");
              this.open = false;
              this.getsartdetail();
            });
          }
        });
      },

      /** 提交修改Postprocess按钮 */
      submitPostprocess() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            updatePostprocess(this.postprocessList).then(response => {
              this.$modal.msgSuccess("修改后处理数据成功");
              this.open = false;
              this.getsartdetail();
            });
          }
        });
      },


      //order文件下载
      getorderfile() {
        this.queryParams.resource = this.urlList.orderUpload;
        download("/cmecommon/download/resource", this.queryParams, "金属打印原始文件：" + this.queryParams.orderId + this.orderfilename);


      },

      //datapreprocess文件下载
      getpreprocessfile() {
        this.queryParams.resource = this.urlList.perprocessUpload;
        download("/cmecommon/download/resource", this.queryParams, "金属打印前处理文件" + this.queryParams.orderId + this.predatafilename);
      },

    }
  }

</script>

<style scoped>
  .dialog-footer {
    float: right
  }

</style>
